package com.xjun.controller;


import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author XJun
 */
@Controller
public class HelloController {
    //网页请求地址
    @RequestMapping("/hello")
    public String hello(Model model){
        //向模型中添加属性msg与值，可以在JSP页面中取出并渲染
        model.addAttribute("msg","Hello SpringMVC Annotation!");
        //被视图解析器处理为:/WEB-INF/jsp/hello.jsp
        return "hello";
    }
}
